package com.qlogic.commons.platform.impls.lucene.handler;

import org.apache.lucene.document.Document;

import java.io.InputStream;

public interface ContentHandler {
	
	public static final String BODY = "body";
	public static final String AUTHOR = "author";
	public static final String TITLE = "title";
	public static final String KEYWORDS = "keywords";
	public static final String SUMMARY = "summary";

	/**
	 * Creates a Lucene Document from an InputStream. This method can return
	 * <code>null</code>.
	 * 
	 * @param is
	 *            the InputStream to convert to a Document
	 * @return a ready-to-index instance of Document
	 */
	public Document getDocument (InputStream is, String encoding) throws ContentHandlerException;
	
	public String getText (InputStream is, String encoding) throws ContentHandlerException;
	
}
